<template>
  <div>
    <el-menu :default-active="activeMenu" @select="handleMenuSelect" class="el-menu-vertical-demo">
<!--      <el-menu-item index="1">书籍管理</el-menu-item>-->
<!--      <el-menu-item index="2">问题管理</el-menu-item>-->
    </el-menu>
    <router-view />
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeMenu: '1',
    };
  },
  methods: {
    handleMenuSelect(index) {
      this.activeMenu = index;
      if (index === '1') {
        this.$router.push('/books');
      } else if (index === '2') {
        this.$router.push('/problems');
      }
    },
  },
};
</script>
